package homeWork;

import java.io.File;
import java.util.Scanner;

public class test03 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        System.out.println("请输入关键字");
        String key = s.nextLine();
        File dir = new File(".");
        if (dir.isDirectory()){
            File[] files = dir.listFiles();
            for(int i=0;i< files.length;i++){
                String filename = files[i].getName();
                if (filename.contains(key)){
                    System.out.println(filename);
                }
            }
        }
    }
}
